Return to doc.sitecore.com

Documentation

The multilevel menu consists of two components: "topmenu.xslt" and "submenu.xslt", where the topmenu builds a horizontal one-level menu from given parameters and the Submenu builds a tree-structure menu from given parameters.

The illustration below shows a sample usage of the components, where the topmenu is being used once, and submenu is being used twice.

 

 

 

We need three templates to make this example work: section, document and context document  

The Topmenu displays all Items of the same level based on the section template. The Submenu1 displays all Items based on the document template. The Submenu2 displays all Items based on the context document template.   

Please refer to the XSL section for more information about XSL renderings.

 

1.  Installation Guide

The XSL Multimenu rendering is distributed as a standard Sitecore package; hence in order to start using it, you should install the package. Please refer to the ' Installing Modules and Packages ' article if you are not familiar with the standard Sitecore Packager tool.   

After the package installation, you will see the XSL menu control in the list of XSL renderings. Thus you will be able to place it on a (sub)layout or tie via placeholder like any usual rendering.

 

2.  User Manual

The Multimenu is an XSL rendering, thus you can work with it like with any other rendering.

 

Example:  

  1. Create three templates (section, document and context document) containing two fields for menu Items :
    Title
    Type: text
    Defines the text for a menu Item 

    Text

    Type: html
    Defines the html data for a menu Item 
      
  2. Create a tree structure for the Multimenu under the Home Item:

To set rendering properties, double-click on it in the Layout view and you’ll see the configuration window. Open the Parameters tab and set the properties.

 


3.  Valid Parameters

Below are the valid parameters for the Topmenu.xslt and Submenu.xslt:

Topmenu.xslt

Name

Description

Default value

fldTitle

Title to display

'Title'

templates

Items based on the templates specified here will be included in the menu.

'!section!document!'

txtClass

class for non-selected Items

'normal'

txtClassSelected

class for a selected Item

'normal'

Make sure to set the "Data source" after dropping this component. Usually this data source would be set to "/sitecore/content/Home".

 

Submenu.xslt

Name

Description

Default value

fldTitle

Title to display in the menu.

'Title'

templates

Items based on the templates specified here will be included in the menu.  

'!section!document!'

txtClass

class for non-selected Items

'normal'

txtClassSelected

class for a selected Item

'normal'

parenttemplate

This parameter is no longer used, though it may be present for the compliance purposes.

 

Make sure to set "Data source" after dropping this component. Data source must be the same as for the Topmenu.xslt.

4.  Sample setup

Sample parameters:
Topmenu paremters:

fldTitle

[using default]

templates

'!section!'

txtClass

txtClass

txtClassSelected

txtClassSelected

 

Submenu parameters:

fldTitle

[using default]

templates

!document!

parenttemplate

[using default]

txtClass

txtClass

txtClassSelected

txtClassSelected

 

Submenu2 parameters:

fldTitle

[using default]

templates

'!context document!'

parenttemplate

 

txtClass

txtClass

txtClassSelected

txtClassSelected

 

 

Sample style sheet:

.txtClass

{

      font-family: Arial;

      font-size: 14px;

      color: Blue;

}

 

.txtClassSelected

{    

      font-family: Arial;    

      font-size: 14px;

      font-weight: bold;

      color: #9900cc;

}